﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCO.BE;
namespace SCO.Comunication
{
    public class OracleComunication
    {
        public pacienteBE datosPersonaRENIEC(pacienteBE objeto)
        {
            try
            {
                //var servicio = new ServicioPersonas.ServicioRENIEC();
                //var datos = servicio.getDatosPersona(objeto.DNIPAC);
                //var resultado = (from c in datos select new pacienteBE() { DNIPAC= c.dni, NOMPAC = c.nombre, APEPPAC = c.apellidoPaterno, APEMPAC = c.apellidoMaterno, SEXPAC = c.sexo, FECNACPAC = c.fechaNacimiento }).First();
                var lista = new List<pacienteBE>();
                lista.Add(new pacienteBE() { DNIPAC = "45842095", NOMPAC = "LUIS", APEMPAC = "LEON", APEPPAC ="CORDOVA", SEXPAC="M", FECNACPAC="03/06/1989" });
                lista.Add(new pacienteBE() { DNIPAC = "12345678", NOMPAC = "JOSE", APEMPAC = "SANCHEZ", APEPPAC = "DURAN", SEXPAC = "M", FECNACPAC = "01/01/1977" });
                lista.Add(new pacienteBE() { DNIPAC = "87654321", NOMPAC = "ALBERTO", APEMPAC = "ORTEGA", APEPPAC = "PEREZ", SEXPAC = "M", FECNACPAC = "23/11/1999" });
                var resultado = lista.Where(c => c.DNIPAC == objeto.DNIPAC).First();
                return resultado;
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}
